import BaseApi from '../BaseApi';

const controller = "/coupon";

export default {

    selectAllCoupon(condition) {
        return this.requestGet(controller, "/selectAllCoupon", condition);
    },
    addOrUpdateCoupon(condition) {
        return this.requestPost(controller, "/addOrUpdateCoupon", condition);
    },
    deleteCoupon(condition) {
        return this.requestPost(controller, "/deleteCoupon", condition);
    },
    /*请求封装*/
    requestPost(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPost(newUrl, condition);

    },
    requestGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestGet(newUrl, condition);
    },


}